/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.settlement.entity.customersettlement;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.modules.base.entity.cars.Tcar;
import org.hibernate.validator.constraints.Length;

/**
 * 客户结算单Entity
 * @author Kilo
 * @version 2021-03-10
 */
@Table(name="t_customer_settlement_detail", alias="a", columns={
		@Column(name="customer_settlement_detail_id", attrName="customerSettlementDetailId", label="客户结算单明细ID", isPK=true),
		@Column(name="car_id", attrName="carId", label="车辆"),
		@Column(name="frame_number", attrName="frameNumber", label="车架号"),
		@Column(name="price", attrName="price", label="车价", comment="车价（外币）"),
		@Column(name="currency", attrName="currency", label="币种"),
		@Column(name="estimate_exchange_rate", attrName="estimateExchangeRate", label="预计汇率"),
		@Column(name="actual_exchange_rate", attrName="actualExchangeRate", label="实际汇率"),
		@Column(name="payable_amount", attrName="payableAmount", label="应收总金额", comment="应收总金额（RMB）"),
		@Column(name="actual_amount", attrName="actualAmount", label="实收总金额", comment="实收总金额（RMB）"),
		@Column(name="stamp_duty", attrName="stampDuty", label="印花税"),
		@Column(name="total_amount", attrName="totalAmount", label="总金额"),
		@Column(name="customer_settlement_id", attrName="customerSettlementId.customerSettlementId", label="客户结算单ID"),
	},  joinTable={
        @JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= Tcar.class, attrName="tcar", alias="b",
                on="b.car_id = a.car_id", columns={
                @Column(name="car_id", label="车辆编码", isPK=true),
                @Column(name="car_name", label="车辆名称", isQuery=false),
        }),
},orderBy="a.customer_settlement_detail_id ASC"
)
public class CustomerSettlementDetail extends DataEntity<CustomerSettlementDetail> {
	
	private static final long serialVersionUID = 1L;
	private String customerSettlementDetailId;		// 客户结算单明细ID
	private String carId;		// 车辆
	private String frameNumber;		// 车架号
	private Double price;		// 车价（外币）
	private String currency;		// 币种
	private String estimateExchangeRate;		// 预计汇率
	private String actualExchangeRate;		// 实际汇率
	private Double payableAmount;		// 应收总金额（RMB）
	private Double actualAmount;		// 实收总金额（RMB）
	private Double stampDuty;		// 印花税
	private Double totalAmount;		// 总金额
	private CustomerSettlement customerSettlementId;		// 客户结算单ID 父类
    private Tcar tcar;
	
	public CustomerSettlementDetail() {
		this(null);
	}


	public CustomerSettlementDetail(CustomerSettlement customerSettlementId){
		this.customerSettlementId = customerSettlementId;
	}
	
	public String getCustomerSettlementDetailId() {
		return customerSettlementDetailId;
	}

	public void setCustomerSettlementDetailId(String customerSettlementDetailId) {
		this.customerSettlementDetailId = customerSettlementDetailId;
	}
	
	@Length(min=0, max=64, message="车辆长度不能超过 64 个字符")
	public String getCarId() {
		return carId;
	}

	public void setCarId(String carId) {
		this.carId = carId;
	}
	
	@Length(min=0, max=100, message="车架号长度不能超过 100 个字符")
	public String getFrameNumber() {
		return frameNumber;
	}

	public void setFrameNumber(String frameNumber) {
		this.frameNumber = frameNumber;
	}
	
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}
	
	@Length(min=0, max=2, message="币种长度不能超过 2 个字符")
	public String getCurrency() {
		return currency;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}
	
	@Length(min=0, max=10, message="预计汇率长度不能超过 10 个字符")
	public String getEstimateExchangeRate() {
		return estimateExchangeRate;
	}

	public void setEstimateExchangeRate(String estimateExchangeRate) {
		this.estimateExchangeRate = estimateExchangeRate;
	}
	
	@Length(min=0, max=10, message="实际汇率长度不能超过 10 个字符")
	public String getActualExchangeRate() {
		return actualExchangeRate;
	}

	public void setActualExchangeRate(String actualExchangeRate) {
		this.actualExchangeRate = actualExchangeRate;
	}
	
	public Double getPayableAmount() {
		return payableAmount;
	}

	public void setPayableAmount(Double payableAmount) {
		this.payableAmount = payableAmount;
	}
	
	public Double getActualAmount() {
		return actualAmount;
	}

	public void setActualAmount(Double actualAmount) {
		this.actualAmount = actualAmount;
	}
	
	public Double getStampDuty() {
		return stampDuty;
	}

	public void setStampDuty(Double stampDuty) {
		this.stampDuty = stampDuty;
	}
	
	public Double getTotalAmount() {
		return totalAmount;
	}

	public void setTotalAmount(Double totalAmount) {
		this.totalAmount = totalAmount;
	}
	
	public CustomerSettlement getCustomerSettlementId() {
		return customerSettlementId;
	}

	public void setCustomerSettlementId(CustomerSettlement customerSettlementId) {
		this.customerSettlementId = customerSettlementId;
	}

    public Tcar getTcar() {
        return tcar;
    }

    public void setTcar(Tcar tcar) {
        this.tcar = tcar;
    }
}